package de.teamgamma.cansat.groundstation.main;

import java.awt.Font;

import javax.swing.JPanel;
import javax.swing.SwingConstants;

import de.szut.gui.language.TranslatableLabel;
import de.szut.gui.language.TranslatableStyledButton;
import de.teamgamma.cansat.groundstation.control.Controller;

/**
 * Default panel for all panels used 
 * @author Marc Huisinga
 *
 */
public abstract class DefaultPanel extends JPanel {

	/**
	 * X-Position of the header
	 */
	public static final int HEADERX = 10;
	/**
	 * Y-Position of the header
	 */
	public static final int HEADERY = 10;
	/**
	 * Width of the header
	 */
	public static final int HEADERWIDTH = Controller.getInstance().getGuiController().getMainFrame().getWidth()-10;
	/**
	 * Height of the header
	 */
	public static final int HEADERHEIGHT = 30;
	/**
	 * X-Position of the return button
	 */
	public static final int RETURNBUTTONX = 499;
	/**
	 * Y-Position of the return button
	 */
	public static final int RETURNBUTTONY = 350;
	/**
	 * Width of the return button
	 */
	public static final int RETURNBUTTONWIDTH = 90;
	/**
	 * Height of the return button
	 */
	public static final int RETURNBUTTONHEIGHT = 20;
	
	private static final long serialVersionUID = 717320814096415703L;

	private TranslatableLabel header;
	private TranslatableStyledButton returnButton;
	
	public DefaultPanel() {
		setLayout(null);
		
		header = new TranslatableLabel();
		header.setFont(new Font("Monospaced", Font.BOLD, 24));
		header.setHorizontalAlignment(SwingConstants.CENTER);
		header.setBounds(HEADERX, HEADERY, HEADERWIDTH, HEADERHEIGHT);
		add(header);
		
		returnButton = new TranslatableStyledButton();
		returnButton.setBounds(RETURNBUTTONX, RETURNBUTTONY, RETURNBUTTONWIDTH, RETURNBUTTONHEIGHT);
		returnButton.setFont(new Font("Tahoma", Font.PLAIN, 14));
		add(returnButton);
	}

	/**
	 * Gets the header on the default panel
	 * @return header
	 */
	public TranslatableLabel getHeader() {
		return header;
	}

	/**
	 * Sets the header on the default panel
	 * @param header
	 */
	public void setHeader(TranslatableLabel header) {
		this.header = header;
	}

	/**
	 * Gets the return button on the default panel
	 * @return return button
	 */
	public TranslatableStyledButton getReturnButton() {
		return returnButton;
	}

	/**
	 * Sets the return button on the default panel
	 * @param returnButton
	 */
	public void setReturnButton(TranslatableStyledButton returnButton) {
		this.returnButton = returnButton;
	}
}
